<template>
	<view class="content">

		<!-- {{emojiList.emoji["[大笑]"]}} -->


		{{hr}} {{min}} {{sec}}

		<rich-text :nodes="n"></rich-text>

		<!-- <view class="data_title__39vye"> -->
		<view class="data_progress__1PKMR">
			<view class="data_proLeft__1gtzQ" :style="{width:pressWidth}"></view>
			<image style="width: 30upx;margin-left: -8px;"
				src="https://webapp.test.shenghua6.cn/st/mini/static/img/xcxydy/zhongjian.png" mode="widthFix"></image>
		</view>
		<!-- </view> -->

		<button type="default" @click="dianjis()"> 增加 </button>




		<view style="display: flex; align-items: center;justify-content: center;">

			<image class="imgss"
				src="https://ourydcimage.shenghua6.cn/2020/09/22/2020092210204263997.gif?x-oss-process=image/bright,15/resize,m_fill,h_250,w_250"
				mode="widthFix" :animation="animationData"></image>
			<view style="width: 300rpx;"> </view>
			<image class="imgss"
				src="https://ourydcimage.shenghua6.cn/2021/08/09/2021080916054437920.jpeg?x-oss-process=image/bright,15/resize,m_fill,h_250,w_250"
				mode="widthFix"></image>

		</view>



		<view class="" v-if="list.length==0&&type==0">
			<view class="" style="height:180upx;">
			</view>

			<view class="iynst">
				<view style="width:50%;text-align: center; ">
					<image style="width: 100%;height: auto;" :src="$BASE_URL +'/st/mini/static/img/gender/ques.png'"
						mode="widthFix">
					</image>

					<view class="texhe">
						怎么能没有消息呢~
					</view>
					<view style="height:10rpx;">

					</view>
					<view>
						快去找人聊聊吧~
					</view>
					<view style="height:120upx;">
					</view>
				</view>
			</view>

			<view class="annius" @click="jiaoy()" v-if="chatRoomList.length !=0">
				快去交友吧
			</view>
		</view>

		<view class="topbox" v-for="(item,index) in  list" @click="dianji">
			<image class="touxiang" :src="item.img">
				<!-- https://ourydcimage.shenghua6.cn/2021/03/03/2021030319002375927.jpg -->
			</image>
			<view style="width:20upx;">
			</view>
			<view class="">
				<view class="name">
					{{item.name}}
					宁财神

				</view>
				<view style="height:10upx;">

				</view>
				<view class="text">
					{{item.text || '收到消息,请打开哩咔APP查看' }}
				</view>
			</view>
			<view class="titme">
				时间
				<!-- {{getDateDiff(item.time)}} -->
			</view>
			<view style="height: 100upx;">
				<view class="yuandian">
				</view>
			</view>
		</view>

		<view style="height: 200upx;">
		</view>
		<u-popup v-model="shareShow" mode="center">
			<image :src="$BASE_URL +'/st/mini/static/img/gender/xztc.png'" mode="widthFix"></image>
			<view style="display:flex;width:100%;margin:-190upx auto;height: 20rpx;">
				<button style="width:50%; height:120upx; display: flex;align-items: center; border:none;" plain="true"
					@click="downApp()">
					<image style="width:100%;" :src="$BASE_URL +'/st/mini/static/img/gender/fuzhi.png'" mode="widthFix">
					</image>
				</button> <button style="width:50%; height:120upx; display: flex;align-items: center; border:none;"
					open-type="contact" plain="true">
					<image style="width:100%;" :src="$BASE_URL +'/st/mini/static/img/gender/qxz.png'" mode="widthFix">
					</image>
				</button>
			</view>

			<view
				style="font-family: PingFangSC-Regular;font-size:26upx;color: #5C60B6;text-align:center;margin-top: 290upx;">
				复制后请在浏览器打开
			</view>
			<view style="height:30upx;"></view>
		</u-popup>






		<view style="height: 300upx;">

		</view>


	</view>
</template>



<!-- <script src="../../../commons/NIM_Web_SDK_miniapp_v8.5.0.js"></script> -->
<script>
	var chat = ''
	import SDK from '@/commons/NIM_Web_SDK_miniapp_v8.5.0.js'

	export default {
		data() {
			return {
				animationData: {},
animation:{},
				pressWidth: '20%',
				type: 0,
				lis: [],

				list: [],
				chatRoomList: [],
				shareShow: false,
				downloadUrl: '',
				$BASE_URL: this.$BASE_URL,
				nim: '',

				// 定义一个变量
				time: '',


				hr: 0,
				min: 0,
				sec: 0,
				n: {},


				// 表情
				emoji: {},


				to: '611113'

			}
		},
		onHide() {
			var _this = this
			//当页面隐藏时清除定时器
			// clearInterval(this.time)
			_this.animationData = {} // 页面关闭
		},

		onLoad(option) {


			// // 把当前发送记录缓存到本地
			// var us = uni.getStorageSync(this.to)

			// // 达到三次禁止发送
			// if (us >= 3) {
			// 	console.log('超出最大次数掉然后出弹窗')
			// 	return
			// }

			// if (us == "") {
			// 	uni.setStorage({
			// 		key: this.to,
			// 		data: 1,
			// 		success: function() {
			// 			console.log('success');
			// 		}
			// 	});
			// } else {
			// 	uni.setStorage({
			// 		key: this.to,
			// 		data: parseInt(us) + 1,
			// 		success: function() {
			// 			console.log('success');
			// 		}
			// 	});
			// }




			this.emoji = {
				"emoji": {
					"[大笑]": {
						file: "emoji_0.png"
					},
					"[可爱]": {
						file: "emoji_01.png"
					},
					"[色]": {
						file: "emoji_02.png"
					},
					"[嘘]": {
						file: "emoji_03.png"
					},
					"[亲]": {
						file: "emoji_04.png"
					},
					"[呆]": {
						file: "emoji_05.png"
					},
					"[口水]": {
						file: "emoji_06.png"
					},
					"[汗]": {
						file: "emoji_145.png"
					},
					"[呲牙]": {
						file: "emoji_07.png"
					},
					"[鬼脸]": {
						file: "emoji_08.png"
					},
					"[害羞]": {
						file: "emoji_09.png"
					},
					"[偷笑]": {
						file: "emoji_10.png"
					},
					"[调皮]": {
						file: "emoji_11.png"
					},
					"[可怜]": {
						file: "emoji_12.png"
					},
					"[敲]": {
						file: "emoji_13.png"
					},
					"[惊讶]": {
						file: "emoji_14.png"
					},
					"[流感]": {
						file: "emoji_15.png"
					},
					"[委屈]": {
						file: "emoji_16.png"
					},
					"[流泪]": {
						file: "emoji_17.png"
					},
					"[嚎哭]": {
						file: "emoji_18.png"
					},
					"[惊恐]": {
						file: "emoji_19.png"
					},
					"[怒]": {
						file: "emoji_20.png"
					},
					"[酷]": {
						file: "emoji_21.png"
					},
					"[不说]": {
						file: "emoji_22.png"
					},
					"[鄙视]": {
						file: "emoji_23.png"
					},
					"[阿弥陀佛]": {
						file: "emoji_24.png"
					},
					"[奸笑]": {
						file: "emoji_25.png"
					},
					"[睡着]": {
						file: "emoji_26.png"
					},
					"[口罩]": {
						file: "emoji_27.png"
					},
					"[努力]": {
						file: "emoji_28.png"
					},
					"[抠鼻孔]": {
						file: "emoji_29.png"
					},
					"[疑问]": {
						file: "emoji_30.png"
					},
					"[怒骂]": {
						file: "emoji_31.png"
					},
					"[晕]": {
						file: "emoji_32.png"
					},
					"[呕吐]": {
						file: "emoji_33.png"
					},
					"[拜一拜]": {
						file: "emoji_160.png"
					},
					"[惊喜]": {
						file: "emoji_161.png"
					},
					"[流汗]": {
						file: "emoji_162.png"
					},
					"[卖萌]": {
						file: "emoji_163.png"
					},
					"[默契眨眼]": {
						file: "emoji_164.png"
					},
					"[烧香拜佛]": {
						file: "emoji_165.png"
					},
					"[晚安]": {
						file: "emoji_166.png"
					},
					"[强]": {
						file: "emoji_34.png"
					},
					"[弱]": {
						file: "emoji_35.png"
					},
					"[OK]": {
						file: "emoji_36.png"
					},
					"[拳头]": {
						file: "emoji_37.png"
					},
					"[胜利]": {
						file: "emoji_38.png"
					},
					"[鼓掌]": {
						file: "emoji_39.png"
					},
					"[握手]": {
						file: "emoji_200.png"
					},
					"[发怒]": {
						file: "emoji_40.png"
					},
					"[骷髅]": {
						file: "emoji_41.png"
					},
					"[便便]": {
						file: "emoji_42.png"
					},
					"[火]": {
						file: "emoji_43.png"
					},
					"[溜]": {
						file: "emoji_44.png"
					},
					"[爱心]": {
						file: "emoji_45.png"
					},
					"[心碎]": {
						file: "emoji_46.png"
					},
					"[钟情]": {
						file: "emoji_47.png"
					},
					"[唇]": {
						file: "emoji_48.png"
					},
					"[戒指]": {
						file: "emoji_49.png"
					},
					"[钻石]": {
						file: "emoji_50.png"
					},
					"[太阳]": {
						file: "emoji_51.png"
					},
					"[有时晴]": {
						file: "emoji_52.png"
					},
					"[多云]": {
						file: "emoji_53.png"
					},
					"[雷]": {
						file: "emoji_54.png"
					},
					"[雨]": {
						file: "emoji_55.png"
					},
					"[雪花]": {
						file: "emoji_56.png"
					},
					"[爱人]": {
						file: "emoji_57.png"
					},
					"[帽子]": {
						file: "emoji_58.png"
					},
					"[皇冠]": {
						file: "emoji_59.png"
					},
					"[篮球]": {
						file: "emoji_60.png"
					},
					"[足球]": {
						file: "emoji_61.png"
					},
					"[垒球]": {
						file: "emoji_62.png"
					},
					"[网球]": {
						file: "emoji_63.png"
					},
					"[台球]": {
						file: "emoji_64.png"
					},
					"[咖啡]": {
						file: "emoji_65.png"
					},
					"[啤酒]": {
						file: "emoji_66.png"
					},
					"[干杯]": {
						file: "emoji_67.png"
					},
					"[柠檬汁]": {
						file: "emoji_68.png"
					},
					"[餐具]": {
						file: "emoji_69.png"
					},
					"[汉堡]": {
						file: "emoji_70.png"
					},
					"[鸡腿]": {
						file: "emoji_71.png"
					},
					"[面条]": {
						file: "emoji_72.png"
					},
					"[冰淇淋]": {
						file: "emoji_73.png"
					},
					"[沙冰]": {
						file: "emoji_74.png"
					},
					"[生日蛋糕]": {
						file: "emoji_75.png"
					},
					"[蛋糕]": {
						file: "emoji_76.png"
					},
					"[糖果]": {
						file: "emoji_77.png"
					},
					"[葡萄]": {
						file: "emoji_78.png"
					},
					"[西瓜]": {
						file: "emoji_79.png"
					},
					"[光碟]": {
						file: "emoji_80.png"
					},
					"[手机]": {
						file: "emoji_81.png"
					},
					"[电话]": {
						file: "emoji_82.png"
					},
					"[电视]": {
						file: "emoji_83.png"
					},
					"[声音开启]": {
						file: "emoji_84.png"
					},
					"[声音关闭]": {
						file: "emoji_85.png"
					},
					"[铃铛]": {
						file: "emoji_86.png"
					},
					"[锁头]": {
						file: "emoji_87.png"
					},
					"[放大镜]": {
						file: "emoji_88.png"
					},
					"[灯泡]": {
						file: "emoji_89.png"
					},
					"[锤头]": {
						file: "emoji_90.png"
					},
					"[烟]": {
						file: "emoji_91.png"
					},
					"[炸弹]": {
						file: "emoji_92.png"
					},
					"[枪]": {
						file: "emoji_93.png"
					},
					"[刀]": {
						file: "emoji_94.png"
					},
					"[药]": {
						file: "emoji_95.png"
					},
					"[打针]": {
						file: "emoji_96.png"
					},
					"[钱袋]": {
						file: "emoji_97.png"
					},
					"[钞票]": {
						file: "emoji_98.png"
					},
					"[银行卡]": {
						file: "emoji_99.png"
					},
					"[手柄]": {
						file: "emoji_100.png"
					},
					"[麻将]": {
						file: "emoji_101.png"
					},
					"[调色板]": {
						file: "emoji_102.png"
					},
					"[电影]": {
						file: "emoji_103.png"
					},
					"[麦克风]": {
						file: "emoji_104.png"
					},
					"[耳机]": {
						file: "emoji_105.png"
					},
					"[音乐]": {
						file: "emoji_106.png"
					},
					"[吉他]": {
						file: "emoji_107.png"
					},
					"[火箭]": {
						file: "emoji_108.png"
					},
					"[飞机]": {
						file: "emoji_109.png"
					},
					"[火车]": {
						file: "emoji_110.png"
					},
					"[公交]": {
						file: "emoji_111.png"
					},
					"[轿车]": {
						file: "emoji_112.png"
					},
					"[出租车]": {
						file: "emoji_113.png"
					},
					"[警车]": {
						file: "emoji_114.png"
					},
					"[自行车]": {
						file: "emoji_115.png"
					}
				}
			}




			//定义this指向
			const that = this;
			//使用定时器 然后使用递归 让每一次函数能调用自己达到倒计时效果
			setInterval(function() {
				that.countdown();
			}, 1000);




			this.n = this.generateRichTextNode("[呆] 我的测试消息 [鬼脸]")
			//  









			//  
			var nim = SDK.NIM
			var nei = uni.getStorageSync("nei")
			//  

			//  IM实例化
			this.$NIM = SDK.NIM.getInstance({
				// debug: true,
				appKey: nei.appKey,
				account: nei.account,
				token: nei.token,
				onconnect: onConnect,
				ondisconnect: onDisconnect,
				// onsessions: onSessions,
				// onupdatesession: onUpdateSession

			});

			function onConnect() {
				console.log("聊天页=========================IM连接成功");





			}

			function onDisconnect(error) {
				// 此时说明 SDK 处于断开状态, 开发者此时应该根据错误码提示相应的错误信息, 并且跳转到登录页面
				console.log("丢失连接");
				console.log(error);
				if (error) {
					switch (error.code) {
						// 账号或者密码错误, 请跳转到登录页面并提示错误
						case 302:
							break;
							// 重复登录, 已经在其它端登录了, 请跳转到登录页面并提示错误
						case 417:
							break;
							// 被踢, 请提示错误后跳转到登录页面
						case "kicked":
							console.log("kicked");

							if (error.reason == "samePlatformKick") {
								uni.showToast({
									title: "您的帐号在异地登陆",
									duration: 2000,
									icon: "none",
								});
								setTimeout(function() {
									//清除本地登录状态
									// uni.clearStorage();
									// 清除本地cookie
									uni.removeStorage({key: 'cookie'});
									//IM实例销毁
									Vue.prototype.$NIM.disconnect();

									//跳转登录页
									uni.redirectTo({
										url: "/pages/login/wxlogin",
									});
								}, 2000);
							}




							if (error.reason == "serverKick") {
								uni.showToast({
									title: "您的帐号已被封禁",
									duration: 2000,
									icon: "none",
								});
								setTimeout(function() {
									//清除本地登录状态
									// uni.clearStorage();
									// 清除本地cookie
									uni.removeStorage({key: 'cookie'});
									//IM实例销毁
									Vue.prototype.$NIM.disconnect();

									//跳转登录页
									uni.redirectTo({
										url: "/pages/login/wxlogin",
									});
								}, 2000);


							}
							break

						default:
							break;
					}
				}
			}





			if (uni.getSystemInfoSync().platform == 'android') {
				this.getAppDownloadUrl('android')
			} else {
				this.getAppDownloadUrl('ios')
			}







			// 监听
			// this.jianting();

			var _this = this

			setTimeout(function() {

				// 执行刷新消息
				_this.jianting()
			}, 500);


		},


		beforeCreate() {
			console.log('最新')
			var cookie = uni.getStorageSync("cookie")



			console.log('判断有无登录', cookie)
			// 判断是否登录
			if (!cookie) {
				uni.navigateTo({
					url: '../login/wxlogin'
				})
				return
			}
		},

		onShow() {
			return
			var _this = this

			setTimeout(function() {

				// 是否显示时快去交友吧
				_this.chaxuntuijian();
				// // 刷新消息列表
				_this.fangfas()

				_this.jianting()
			}, 500);






		},
		methods: {














			// 生成富文本方法

			generateRichTextNode(text) {
				//  
				//  

				let emoji = this.emoji.emoji


				let tempStr = text
				let richTextNode = []
				let leftBracketIndex = tempStr.indexOf('[')
				let rightBracketIndex = tempStr.indexOf(']')
				let countOfWord = 0


				Array.from(tempStr).map(item => {
					if (item != '[' && item != ']') {
						countOfWord++
					}
				})
				if (leftBracketIndex == -1 || rightBracketIndex == -1 || countOfWord == 0) { //没有emoji
					richTextNode.push({
						type: 'text',
						text: tempStr
					})
					return richTextNode
				}
				while (tempStr.length != 0) {
					leftBracketIndex = tempStr.indexOf('[')
					rightBracketIndex = tempStr.indexOf(']')
					if (leftBracketIndex == 0) { // 开头是[
						rightBracketIndex = tempStr.indexOf(']')
						if (rightBracketIndex == -1) {
							richTextNode.push({
								type: 'text',
								text: tempStr
							})
							tempStr = ''
						} else {
							let emojiName = tempStr.slice(0, rightBracketIndex + 1)

							if (emoji[emojiName]) { // 有效emoji

								richTextNode.push({
									name: 'img',
									attrs: {
										width: '30rpx',
										height: '30rpx',
										src: 'http://yx-web.nosdn.127.net/webdoc/h5/emoji/emoji/' + emoji[
											emojiName].file
									}
								})

							} else { //无效emoji
								richTextNode.push({
									type: 'text',
									text: emojiName
								})
							}
							tempStr = tempStr.substring(rightBracketIndex + 1, tempStr.length)
						}
					} else { // 开头不是[
						if (leftBracketIndex == -1) { // 最后全是文字
							richTextNode.push({
								type: 'text',
								text: tempStr.slice(0, tempStr.length)
							})
							tempStr = ''
						} else {
							richTextNode.push({
								type: 'text',
								text: tempStr.slice(0, leftBracketIndex)
							})
							tempStr = tempStr.substring(leftBracketIndex, tempStr.length + 1)
						}
					}
				}
				return richTextNode
			},








			// 倒计时

			countdown: function() {
				//定义this指向
				const that = this;

				//设置结束时间
				const end = '1637059595385';
				//设置开始时间
				const now = new Date().getTime();

				// 做判断当倒计时结束时都为0
				if (now >= end) {
					//  
					that.day = 0;
					that.hr = 0;
					that.min = 0;
					that.sec = 0;
					return;
				}
				//  
				// 用结束时间减去当前时间获得倒计时时间戳
				const msec = end - now;
				let day = parseInt(msec / 1000 / 60 / 60 / 24); //算出天数
				let hr = parseInt((msec / 1000 / 60 / 60) % 24); //算出小时数
				let min = parseInt((msec / 1000 / 60) % 60); //算出分钟数
				let sec = parseInt((msec / 1000) % 60); //算出秒数
				//给数据赋值
				that.day = day;
				that.hr = hr > 9 ? hr : "0" + hr;
				that.min = min > 9 ? min : "0" + min;
				that.sec = sec > 9 ? sec : "0" + sec;
				// that.time =  hr + min + sec 

			},









			dianjis: function() {

				this.pressWidth = '60%'



				 this.animation = uni.createAnimation()

		
			this.animation.translateX(100).step({duration:1000})
			       
			        this.animationData = this.animation.export()
			},



			// 动画还原
			reset: function() {

				this.animation.rotate(0, 0)
					.scale(1).translateY(0)
					.translate(0, 0)
					.skew(0, 0)
					.step({
						duration: 0
					})
				this.animationData = this.animation.export()
				this.pnglist.splice(0, 1)
			},


   
			// 查询女神厅
			chaxuntuijian: function() {
				var data = {
					url: '/web/p1/chatroom/pagelist',
					methods: 'post',
					data: {
						apiVersion: "4.1",
						page: 1,
						roomType: 999
					}
				}


				this.$http(data).then(res => {
					if (res.data.code == 0) {
						// 判断女神厅
						this.chatRoomList = res.data.data.chatRoomList.filter(function(item) {
							return item.roomType == 27
						});
					}

				})

			},




			jianting: function() {
				// setOptions
				var _this = this
				this.$NIM.setOptions({
					onsessions: onSessions,
					onupdatesession: onUpdateSession
				});

				function onSessions(sessions) {
					console.log('收到会话列表', sessions);
					setTimeout(function() {
						uni.stopPullDownRefresh();
						// 执行刷新消息
						_this.fangfas()
					}, 1000);
				}

				function onUpdateSession(session) {
					console.log('会话更新了', session);
					setTimeout(function() {
						uni.stopPullDownRefresh();
						// 执行刷新消息
						_this.fangfas()
					}, 2000);
				}
			},










			fangfas() {
				return
				// 获取用户资料
				console.log('重新请求')
				var timestamp1 = Date.parse(new Date());
				var _this = this
				this.$NIM.getServerSessions({
					minTimestamp: 0, // 获取 1571039417853 时间之后更新的会话，增量获取
					maxTimestamp: timestamp1, // 非第一页，上一页会话列表最小的时间时1571039418800
					limit: 100,
					done: function(error, obj) {
						console.log('获取会话列表' + (!error ? '成功' : '失败'), error, obj);
						_this.list = []
						// var name = uni.getStorageSync("userInfo").nickName
						var lis = obj.sessionList.filter(function(item) {
							console.log('打印', JSON.parse(item.lastMsg.custom))
							return JSON.parse(item.lastMsg.custom).headImg && JSON.parse(item.lastMsg
									.custom).nickName != '官方公告' && JSON.parse(item.lastMsg.custom)
								.nickName != '系统通知'
						});





						for (var i = 0; i < lis.length; i++) {
							// 对方id
							var to = lis[i].lastMsg.sessionId.slice(4);
							// 聊天内容
							var text = lis[i].lastMsg.text;
							// 聊天时间
							var time = lis[i].lastMsg.time;
							if (text != '') {
								_this.xinxi(to, text, time, i)
							}
						}

					}
				});
			},

			// 获取信息
			xinxi: function(to, text, time, i) {

				//  
				//  
				var _this = this

				_this.$NIM.getUser({
					account: to,
					done: getUserDone
				});

				function getUserDone(error, user) {
					console.log(error, i);
					console.log(user, i);

					let obj = {
						img: _this.jiexi(user.avatar),
						name: user.nick,
						text: text,
						time: time,

					}
					console.log('第' + i + '条', user.avatar)
					if (user.avatar != undefined) {
						_this.list.push(obj)
					}
				}
			},



			jiaoy: function() {
				uni.switchTab({
					url: '../index/index'
				})
			},

			// 解析头像地址
			jiexi: function(e) {
				return this.headImg = this.$global.getImageUrl(e,
					"https://ourydcimage.shenghua6.cn"
				);
			},

			jiexis: function(e) {

				return this.$global.getImageUrl(
					e,
					"https://ourydcimage.shenghua6.cn"
				);
			},

			// 解析名字	




			getDateDiff: function(dateTimeStamp) {
				var minute = 1000 * 60;
				var hour = minute * 60;
				var day = hour * 24;
				var halfamonth = day * 15;
				var month = day * 30;
				var now = new Date().getTime();
				var diffValue = now - dateTimeStamp;
				if (diffValue < 0) {
					return;
				}
				var monthC = diffValue / month;
				var weekC = diffValue / (7 * day);
				var dayC = diffValue / day;
				var hourC = diffValue / hour;
				var minC = diffValue / minute;
				if (monthC >= 1) {
					var result = "" + parseInt(monthC) + "月前";
				} else if (weekC >= 1) {
					var result = "" + parseInt(weekC) + "周前";
				} else if (dayC >= 1) {
					var result = "" + parseInt(dayC) + "天前";
				} else if (hourC >= 1) {
					var result = "" + parseInt(hourC) + "小时前";
				} else if (minC >= 1) {
					var result = "" + parseInt(minC) + "分钟前";
				} else
					var result = "刚刚";
				return result;
			},

			dianji() {
				this.shareShow = true
			},


			// getwebtk() {
			// 	var data = {
			// 		url: '/web/nv1/auth/getwebtk',
			// 		methods: 'post',
			// 		data: {
			// 			userId: this.userId
			// 		}
			// 	}
			// 	this.$http(data).then(res => {
			// 		this.tk = res.data.data.tk
			// 	})
			// }


			getAppDownloadUrl(clientType) {

				var data = {
					url: '/web/v2/api/newApi/app/getAppDownloadUrl',
					methods: 'post',
					data: {
						clientType: uni.getStorageSync("qudao")
					}
				}
				this.$http(data).then(res => {

					this.downloadUrl = res.data.data.url
				})
			},



			downApp() {

				this.copy(this.downloadUrl)
				// uni.showModal({
				// 	title: '下载“哩咔”APP体验更多精彩内容',
				// 	content: this.downloadUrl + '\n复制地址到浏览器下载',
				// 	confirmText: "一键复制", // 确认按钮文字  
				// 	showCancel: true, // 是否显示取消按钮，默认为 true
				// 	success: (res) => {
				// 		if (res.confirm) {
				// 			this.copy(this.downloadUrl)
				// 		} else {
				// 			console.log('else', res)
				// 		}
				// 	}
				// })
			},
			copy(value) {
				uni.setClipboardData({
					data: value, //要被复制的内容
					success: function() {
						//重点~做笔记
						//在success中加入uni.hideToast()可以解决
						uni.showToast({
							title: '复制成功',
							duration: 2000,
							icon: 'none'
						});
						//以下就可自定义操作了~
					},
					fail: function(err) {
						uni.showToast({
							title: '复制失败',
							duration: 2000,
							icon: 'none'
						});
					}
				});
			},



			chats: function() {

				// chat = SDK.Chat.getInstance({
				// })


			},



		},


		// 下拉刷新延迟一秒 关闭动画
		onPullDownRefresh() {
			var _this = this
			console.log('refresh');
			setTimeout(function() {
				_this.type = 1
				uni.stopPullDownRefresh();
				// 执行刷新消息
				_this.fangfas()
			}, 1000);
		},


		mounted: function() {

		}
	}
</script>

<style lang="scss" scoped>
	// @import './style/members.css';



	.imgss {
		width: 120upx;
		height: 120upx;
		border-radius: 50%;
	}



	.data_progress__1PKMR {
		display: flex;
		width: 100%;
		height: 50rpx;
		margin-top: 10rpx;
		background: #F15D5D;
		border-radius: 16rpx;
		overflow: hidden;

		.data_proLeft__1gtzQ {

			transition: width 2s;
			width: 55%;
			height: 100%;
			background: linear-gradient(0deg, transparent 0px, #067ee7 0);
			border-top-left-radius: 16rpx;
			border-bottom-left-radius: 16rpx;
		}
	}



	page {
		width: 100%;
		height: 100%;
	}

	.content {
		// height: 100%;

	}

	.topbox {
		width: 90%;

		margin: 40upx auto;
		display: flex;
		align-items: center;
	}

	.touxiang {
		width: 100upx;
		height: 100upx;
		border-radius: 50%;

	}

	.titme {
		font-family: PingFangSC-Regular;
		font-size: 24upx;
		color: #9799B2;
		margin-left: auto;
		height: 80upx;

	}

	.text {
		font-family: PingFangSC-Regular;
		font-size: 24upx;
		color: #9799B2;

		width: 400upx;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;


	}

	.name {
		font-family: PingFangSC-Regular;
		font-size: 30upx;
		color: #3B3F63;
		letter-spacing: 0;
		text-align: left;
	}

	.iynst {
		display: flex;
		justify-content: center;
		align-items: center;
		font-family: PingFangSC-Regular;
		font-size: 31upx;
		color: #9E9E9E;
	}

	.annius {
		width: 500upx;

		line-height: 104upx;
		margin: 0 auto;
		text-align: center;
		color: #FFFFFF;
		background-image: linear-gradient(-44deg, #7078FF 0%, #B1A4FF 100%, #B1A4FF 100%);
		box-shadow: 0 8px 9px 0 rgba(255, 255, 255, 0.72), 0 14px 9px 0 #DEF2FF, inset 0 0 9px 4px rgba(250, 230, 255, 0.16);
		border-radius: 52.5px;
		border-radius: 52.5px;
	}

	.yuandian {
		width: 15upx;
		height: 15upx;
		border-radius: 50%;
		background: red;

	}

	// 去掉弹窗圆角
	.content /deep/ .u-mode-center-box {
		background: none;
	}
</style>
